package org.jeecgframework.web.service;
import org.jeecgframework.core.common.service.CommonService;
import org.jeecgframework.web.service.impl.ZyContactsServiceImpl;
import org.jeecgframework.web.system.pojo.base.TSUser;
import org.jeecgframework.web.system.pojo.base.ZyContactsEntity;

import java.io.Serializable;
import java.util.List;

public interface ZyContactsServiceI extends CommonService{
	
 	public <T> void delete(T entity);
 	
 	public <T> Serializable save(T entity);
 	
 	public <T> void saveOrUpdate(T entity);

 	/**
	 * 默认按钮-sql增强-新增操作
	 * @param id
	 * @return
	 */
 	public boolean doAddSql(ZyContactsEntity t);
 	/**
	 * 默认按钮-sql增强-更新操作
	 * @param id
	 * @return
	 */
 	public boolean doUpdateSql(ZyContactsEntity t);
 	/**
	 * 默认按钮-sql增强-删除操作
	 * @param id
	 * @return
	 */
 	public boolean doDelSql(ZyContactsEntity t);

	/**@author xiul
	 * 2016-6-23 下午1:46:10
	 * Description
	 * @param belongOrg
	 * @param id
	 * @return null 不存在联系人，not null 存在联系人
	 */
	public String checkTpIpHeaderUnique(String belongOrg, String id);

	/**@author xiul
	 * 2016-6-23 下午6:35:15
	 * Description
	 * @param name 姓名
	 * @param cellphone1 电话
	 * @param id 联系人ID
	 */
	public boolean checkCtUnique(String name, String cellphone1, String id);

    public ZyContactsEntity findContactByUserName(String userName);

    /**
    * @Description  
    * @Author        大伟
    * @Date          2016/10/30 15:01
    * @param         
    * @return         
    */
    public List<ZyContactsEntity> findContactsListByCinema(String cinemaId);

    /**
    * @Description
    * @Author        大伟
    * @Date          2016/10/30 15:30
    * @param
    * @return
    */
    public List<ZyContactsEntity> findContactsInSameCinema(String contactId);

    public List<ZyContactsServiceImpl.ZyContactsVo> genViewObject(List<ZyContactsEntity> contacts);

    public ZyContactsEntity addContactByUser(TSUser user);

	/**
	 * 根据电话，查找第一个联系人信息
	 * @param phone
	 * @return
	 */
	public List<ZyContactsEntity> getAddressByPhone(String phone);
}

